package com.databasir.dao.tables;


import com.databasir.dao.Databasir;
import com.databasir.dao.tables.records.DataSourceRecord;
import org.jooq.*;
import org.jooq.Record;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;

import java.time.LocalDateTime;

@SuppressWarnings({"all","unchecked","rawtypes"})
public class DataSourceTable extends TableImpl<DataSourceRecord> {

    private static final long servialVersionUID=1;

    /**
     * the reference instance of the <code>databasir.data_source</code>
     *
     * */
    private static final DataSourceTable DATA_SOURCE=new DataSourceTable();


    /**
     * the class holding records of the types
     *
     * */
    @Override
    public Class<DataSourceRecord> getRecordType(){
      return DataSourceRecord.class;
    }
    /**
     * the column <code>databasir.data_ource.id</code>
     * */
     public final TableField<DataSourceRecord,Integer> ID=createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true),this,"");


    /**
     * The column <code>databasir.data_source.project_id</code>.
     */
    public final TableField<DataSourceRecord,Integer> PROJECT_ID=createField(DSL.name("project_id"),SQLDataType.INTEGER.nullable(false),this,"");

    /**
     * The column <code>databasir.data_source.database_name</code>.
     */
    public final TableField<DataSourceRecord, String> DATABASE_NAME = createField(DSL.name("database_name"), SQLDataType.VARCHAR(255).nullable(false), this, "");


    /**
     * The column <code>databasir.data_source.schema_name</code>.
     */
    public final TableField<DataSourceRecord, String> SCHEMA_NAME = createField(DSL.name("schema_name"), SQLDataType.VARCHAR(255).nullable(false), this, "");


    /**
     * The column <code>databasir.data_source.database_type</code>.
     */
    public final TableField<DataSourceRecord, String> DATABASE_TYPE = createField(DSL.name("database_type"), SQLDataType.VARCHAR(255).nullable(false), this, "");

    /**
     * The column <code>databasir.data_source.url</code>.
     */
    public final TableField<DataSourceRecord, String> URL = createField(DSL.name("url"), SQLDataType.CLOB.nullable(false), this, "");

    /**
     * The column <code>databasir.data_source.username</code>.
     */
    public final TableField<DataSourceRecord, String> USERNAME = createField(DSL.name("username"), SQLDataType.CLOB.nullable(false), this, "");

    /**
     * The column <code>databasir.data_source.password</code>.
     */
    public final TableField<DataSourceRecord, String> PASSWORD = createField(DSL.name("password"), SQLDataType.CLOB.nullable(false), this, "");

   /**
    * The column <code>databasir.data_source.update_at</code>
    *
    * */
   public final TableField<DataSourceRecord, LocalDateTime> UPDATE_AT=createField(DSL.name("update_at"),SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP",SQLDataType.LOCALDATETIME)),this,"");

   /**
    * The column <code>databasir.data_source.create_at</>
    *
    * */
   public final TableField<DataSourceRecord,LocalDateTime> CREATE_AT=createField(DSL.name("create_at"),SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP",SQLDataType.LOCALDATETIME)),this,"");

   private DataSourceTable(Name alias, Table<DataSourceRecord> aliased){
       this(alias,aliased,null);
 }
  private DataSourceTable(Name alias, Table<DataSourceRecord> aliased, Field<?>[] parameters){
      super(alias,null,aliased,parameters,DSL.comment(""),TableOptions.table());
  }

  /**
   * create an aliased <code>databasir.data_source</code> table reference
   *
   *
   * */
  public DataSourceTable(String aliased){
    this(DSL.name(aliased),DATA_SOURCE);
  }
    /**
     * Create an aliased <code>databasir.data_source</code> table reference
     */
    public DataSourceTable(Name alias) {
        this(alias, DATA_SOURCE);
    }

   /**
    *
    * create a <code>databasir.data_source</code> table reference
    *
    * */
    public DataSourceTable(){
     this(DSL.name("data_source"),null);
    }

    public <O extends Record> DataSourceTable(Table<O> child,ForeignKey<O,DataSourceRecord> key){
       super(child,key,DATA_SOURCE);
    }

    @Override
    public Schema getSchema(){

        return aliased() ? null: Databasir.DATABASIR;
    }

    @Override
   public Identity<DataSourceRecord,Integer> getIdentity(){
        return (Identity<DataSourceRecord, Integer>) super.getIdentity();
    }

    @Override
    public UniqueKey<DataSourceRecord> getPrimaryKey(){
        return Key
    }



























}


